1. Technical Field
The present invention relates in general to disk storage media and in particular to error handling and recovery for disk storage media. Still more particularly, the present invention relates to relocating unreliable disk sectors when read errors are received while indicating to the user the status of data within a replacement sector.
2. Description of the Related Art
Many contemporary disk drives perform relocation of bad sectors to reserved replacement sectors on the drive. When a sector being written to is determined to be bad, a good replacement sector is substituted for the bad sector. However, when there are no more replacement sectors set aside by the disk drive and another sector is determined to be bad, a Write Error or a Read Error should be returned to the operating system by the drive through the adapter and/or device driver, so that some action may be taken by the operating system to preserve the data being written.
Reporting of write errors or faults by device drivers, adapters, and/or disk drives when an attempted write to the hard disk drive is unsuccessful represents the ideal situation. Under these conditions, the system or user application has an opportunity to preserve the data by writing it elsewhere. However, the error may not be detected when the data is written, the error may not be properly reported if detected, or the data may be corrupted after being written to the disk media. The first two circumstances depend on the presence, reliability, and/or thoroughness of error detection, reporting and correction mechanisms for the disk drive, adapter, and device driver. The last circumstance results from failure of the disk media for any one of a number of reasons such as head damage to the disk media, stray magnetic fields, or contaminants finding their way into the disk drive.
In situations where the data was presumed to be properly written to the disk but returns a CRC error when read, the data may not be recreatable if it was not backed up elsewhere. The unrecoverable sector may be replaced, but the user must be made aware of the correctness of the data within the sector.
It would be desirable, therefore, to provide a mechanism for replacing an unrecoverable disk sector with a replacement sector while indicating, for the user, the correctness of data within the replacement sector.